<script setup>
import { inject } from 'vue'
const money = inject('xxx')
const setMoney = inject('setMoney')
const btnClick = () => {
  setMoney(50)
}
</script>
<template>
  <div>我是子组件----{{ money }}</div>
  <button @click="btnClick">调用setMoney</button>
</template>
<style></style>
